# Include "RSA. HPP"
Class prime_factory
{
Unsigned NP;
Unsigned * pl;
Public:
Prime_factory ();
~ Prime_factory ();
Vlong find_prime (vlong START );
};
// Prime factory implementation
Static int is_probable_prime (const vlong P)
{
// Test Based on fermats Theorem A ** (p-1) = 1 mod p for prime p
// For 1000 bit numbers this can take quite a
* @return Iplocation
*/
function __construct ($filename = "QQWry.Dat") {
$this->FP = 0;
if ($this->FP = @fopen ($filename, ' RB ')!== false) {
$this->firstip = $this->getlong ();
$this->lastip = $this->getlong ();
$this->totalip = ($this->lastip-$this->firstip)/7;
Register the destructor so that it executes at the end of the program execution
Register_shutdown_function (Array ( $this, ' __construct '));
}
}
/**
* Return
;
}
}
/**
* Returns the long integer number of reads
* @access Private
* @return int
*/
Public Function Getlong () {
//Converts the Read Little-endian encoded 4 bytes to a long integer
$result = Unpack (' Vlong ', fread ($this-GT;FP, 4));
return $result [' Long '];
}
/**
* Returns the 3-byte long integer read
*
* @access Private
* @return int
*/
Public Function Getlong3 () {
//Converts the Read Little-endian encoded
Include ("ipcheck.class.php");$ipinfo =$_post[' Ipinfo '];$iptest =new iplocation ();echo $iptest->getlocation ($ipinfo);?>
The ipcheck.class.php code is as follows
Class Iplocation {/*** QQWry.Dat file pointer* @var Resource*/var $fp;/*** Offset address of the first IP record** @var int*/var $firstip;/*** Offset address of the last IP record** @var int*/
var $lastip;
/*** Total number of IP records (does not contain version information records)** @var int*/
var $totalip;
/*** Returns th
long integers read.* @ Access private* @ Return int*/Function getlong (){// Convert the 4 bytes of the read little-endian encoding to the long integer$ Result = unpack ('vlong', fread ($ this-> fp, 4 ));Return $ result ['long'];}/*** Returns the number of long integers read in three bytes.** @ Access private* @ Return int*/Function getlong3 (){// Convert the three bytes of the read little-endian encoding into a long integer.$ Result = unpack ('
(){// Read the four bytes of little-endian encoding and convert them into long integer values.$ Result = unpack ('vlong', fread ($ this-> fh, 4 ));Return $ result ['long'];}
Function getLong3 (){// Read the three bytes of little-endian encoding and convert them into long integer values.$ Result = unpack ('vlong', fread ($ this-> fh, 3). chr (0 ));Return $ result ['long'];}
// Query informationFunction getI
interface to sort the Key. When the Writable class is compared, the default method of Hadoop is to first deserialize the serialized object byte stream as an object, and then compare (compareTo method ), the comparison process requires a deserialization step. RawComparatorComparison at the byte stream layer instead of deserializationIn this way, the deserialization process is saved, thus accelerating program running. The IntWritable, LongWritabe, and other classes provided by Hadoop have impleme
();$ This-> lastip = $ this-> getlong ();$ This-> totalip = ($ this-> lastip-$ this-> firstip)/7;}}/*** Returns the number of long integers read.* @ Access private* @ Return int*/Public function getlong (){// Convert the 4 bytes of the read little-endian encoding to the long integer$ Result = unpack ('vlong', fread ($ this-> fp, 4 ));Return $ result ['long'];}/*** Returns the number of long integers read in three bytes.** @ Access private* @ Return i
...
Vlong:
The rule is the same as that of Vint, and the maximum number of bytes is different.
Between 1 and 9 bytes
CHAR: A series of bytes encoded by the UTF-8.
String: A string is first a Vint that represents the number of characters contained in the string, followed by the Character Sequence chars encoded by the UTF-8.
You can view the types in dataoutput. Java and datainput. java. The following uses dataoutput. Java as an exam
*/Public function getlong (){// Convert the 4 bytes of the read little-endian encoding to the long integer$ Result = unpack ('vlong', fread ($ this-> fp, 4 ));Return $ result ['long'];}/*** Returns the number of long integers read in three bytes.** @ Access private* @ Return int*/Public function getlong3 (){// Convert the three bytes of the read little-endian encoding into a long integer.$ Result = unpack ('vlong
IP address query, IP query, IP location query
include ("ipcheck.class.php"); $ipinfo =$_post[' ipinfo '; $iptest =new Iplocation (); Echo $iptest->getlocation ($ipinfo); Okay, now look at the ipcheck.class.php file.
/*** @author NET is like the wind* e-mail:rainrenamy@gmail.com* Personal website: http://www.adminfan.com* Demo Address: http;//www.adminfan.com/seo/ip.php*/Class Iplocation {/*** QQWry.Dat file pointer* @var Resource*/var $fp;/*** Offset address of the first IP
Php queries the region (pure ip database) based on the ip address ). Pure ip library download? PhpclassIpLocation {*** @ varresource pointer * private $ fp; *** offset address of the first IP record * @ varint * private $ firstip; * ** download the last IP record from the pure ip library
Fp = 0; if ($ this-> fp = @ fopen ($ filename, 'RB '))! = False) {$ this-> firstip = $ this-> getlong (); $ this-> lastip = $ this-> getlong (); $ this-> totalip = ($ this-> lastip-$ this-> firstip)/7 ;}} /*
/*--------------------------------------------------
ip2address [Qqwry.dat]
--------------------------------------------------*/
Class IP {
var $fh; IP database file handle
var $first; First Index
var $last; Last index
var $total; Total indexes
constructor function
function __construct () {
$this->fh = fopen (' Qqwry.dat ', ' RB '); Qqwry.dat file
$this->first = $this->getlong4 ();
$this->last = $this->getlong4 ();
$this->total = (
* @return int
*/
Public Function Getlong () {
Converts the Read Little-endian encoded 4 bytes to a long integer number
$result = Unpack (' Vlong ', fread ($this-GT;FP, 4));
return $result [' Long '];
}
/**
* Returns the number of 3-byte long integers read
*
* @access Private
* @return int
*/
Public Function Getlong3 () {
Converts the Read Little-endian encoded 3 bytes to a long integer number
$result = Unpack ('
Pure IP Library Download
fp = 0; if ($this-GT;FP = @fopen ($filename, ' RB ')!== false) {$this->firstip = $this->getlong (); $this->lastip = $this->getlong (); $this->totalip = ($this->lastip-$this->firstip)/7; }}/** * Returns the read number of long integers * @access private * @return int */Public Function Getlong () {//Littl to be read E-endian encoded 4 bytes into a long integer $result = unpack (' Vlong ',
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.